<template>
    <div>
      <zh-form ref="formRef" :md="24" :lg="24" :xl="24"  :model="appClassInfo" :rules="rules" labelWidth="120">
        <zh-form-select
            prop="appId"
            :lazy="true"
            label="所属应用"
            v-model="appClassInfo.appId"
            :fieldNames="{ label: 'appName', value: 'appId' }"
            funcCode="application0012"
            :disabled="props.displayFlag"
            searchField="appName"
        ></zh-form-select>
        <zh-form-input prop="fileClassCode" label="文件分类编码"  v-model="appClassInfo.fileClassCode"
                       disabled></zh-form-input>
        <zh-form-input prop="fileClassTitle" label="文件分类"  v-model="appClassInfo.fileClassTitle"
                       disabled></zh-form-input>
        <zh-form-input prop="fileClassPath" label="存放基础路径"  v-model="appClassInfo.fileClassPath"
                       :disabled="props.displayFlag"></zh-form-input>
        <!-- <zh-form-input type="date" prop="expireTime" label="到期时间"  v-model="appClassInfo.expireTime"
                       :disabled="props.displayFlag"></zh-form-input> -->
        <zh-form-date
				prop="expireTime"
				label="到期时间"
				placeholder="请输入到期时间"
				type="datetime"
				v-model="appClassInfo.expireTime"
			></zh-form-date>
      </zh-form>
    </div>
</template>

<script lang="ts" setup name="appClassInfo">
import {FormInstance} from "element-plus";
import ZhForm from "@/components/zh-form/index.vue";

// ------------------变量区------------------------------
const props = defineProps({
  scrollHeight: {
    type: String,
    default: ''
  },
  displayFlag: {
    type: Boolean,
    default:false
  },
});
const formRef = ref<FormInstance>();
const appClassInfo = ref<any>({
});

const rules = reactive({
  appId: [
    {
      required: true,
      message: '请选择需要授权的应用',
      trigger: 'blur',
    },
  ],
  fileClassCode: [
    {
      required: true,
      message: '请选择需要授权的文件分类',
      trigger: 'blur',
    },
  ],
  expireTime: [
    {
      required: true,
      message: '请选择过期时间',
      trigger: 'blur',
    },
  ]
});

const state = reactive({
  dictData:[],
});

//------------------初始化------------------------------


//--------------------------定义调用方法--------------------------------------------------
function setInitData(info) {
  formRef.value?.resetFields();
  if (info) {
    appClassInfo.value=info;
  }
}

//------------设置给父组件调用的数据/方法(组件)-----------
defineExpose({setInitData,appClassInfo});
</script>
